<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h4 v-red>你好世界</h4>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const app = new Vue({
      el:'#app',
      directives:{
        red:{
          bind(el){
            el.style.color = 'red';
          }
        }
      }
    })
  </script>
</body>
</html>